#!/usr/bin/python
# -*-coding: UTF-8 -*-
"""
# Time: 2024/5/12 8:38
# @Author: 修养
# @Project_name: PROJECT_NAME
"""
# a = 'ST'  # 全局变量
# ENV = "ST"  # 全部大写的变量为常量
#
# def do():
#     a = "UAT"
#     ENV = "UAT"
#     return a, ENV
#
#
# c = do()
# print("这是通过函数修改后返回的变量值：", c)
# print("这是通过函数修改后返回的变量值：", c[0], c[1])
# print("这是获取全局变量的值：", a)

a = 'ST'  # 全局变量
ENV = "ST"  # 全部大写的变量为常量


def updateEnv():
    a = "UAT"
    ENV = "UAT"
    return a, ENV


env = updateEnv()
print(env)


#
# def login_info(username, password):
#     user = {}
#     if username:
#         user["userName"] = username
#     else:
#         print("用户名不能为空！")
#     if password:
#         print(password)
def login_info(userName, passWord):
    user = {}
    if userName:
        user["userName"] = userName
    else:
        print("用户名不能为空")
    if passWord:
        user["passWord"] = passWord
    else:
        print("用户密码不能为空")
    return user


userInfo = login_info("admin", "123456")
print("登录用户信息：", userInfo)


#
# def exceptionInfo(a, b):
#     try:
#         c = a % b
#         return c
#     except Exception:
#         print("参数有误，请检查后重新输入！")
#     finally:
#         print("输入参数：", a, b)
#
#
# value = exceptionInfo(10, 8)
# print(value)
#
# value = exceptionInfo(10, 0)
# print(value)
def exceptionInfo(m, n):
    try:
        c = m % n
        return c
    except ZeroDivisionError:
        msg = "参数有误，请检查输入参数！"
        return msg
    finally:
        print("输入的参数：", m, n)


value = exceptionInfo(10, 8)
print(value)